﻿using JiveMessenger.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace JiveMessenger.ValidationRules
{
    public class EmailValidation : ValidationRule
    {
        public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
        {
            if (value is string)
            {
                string inputString = (string)value;
                if (!StaticMethods.IsValidEmail(inputString))
                    return new ValidationResult(false, "Input is not a valid email address");

            }
            return ValidationResult.ValidResult;
        }
    }
}
